# 元素文本定位
# 写法： //*[text()="文本"]
# 语法： 浏览器对象.find_element(by=By.XPATH,value="xpath表达式")
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("http://121.43.169.97:8848/pageA.html")
# 通过文本定位，访问百度
driver.find_element(By.XPATH, value="//*[text()='百度']").click()

time.sleep(2)
driver.quit()
